package com.sample.wanandroidx.support

import com.rxjava.rxlife.lifeOnMain
import com.sample.library.IView
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.functions.Consumer

import rxhttp.wrapper.param.RxHttp

object HttpUtil {

    fun empty() = emptyMap<String, String>()

    /**
     * get 返回一个字符串
     */
    fun getString(
        iView: IView,
        url: String, onNext: Consumer<String>,
    ): Disposable? {
        return RxHttp.get(url).asString().lifeOnMain(iView.getLifecycleOwner()).subscribe(onNext)
    }

}





